<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditUserTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">                    
                    <h:outputLabel value="#{bundle.EditUserLabel_name}" for="name" />
                    <h:inputText id="name" value="#{userController.selected.name}" title="#{bundle.EditUserTitle_name}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_surname}" for="surname" />
                    <h:inputText id="surname" value="#{userController.selected.surname}" title="#{bundle.EditUserTitle_surname}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_surname}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_email}" for="email" />
                    <h:inputText id="email" value="#{userController.selected.email}" title="#{bundle.EditUserTitle_email}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_password}" for="password" />
                    <h:inputText id="password" value="#{userController.selected.password}" title="#{bundle.EditUserTitle_password}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{userController.selected.phone}" title="#{bundle.EditUserTitle_phone}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_phone}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_address}" for="address" />
                    <h:inputText id="address" value="#{userController.selected.address}" title="#{bundle.EditUserTitle_address}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_address}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_city}" for="city" />
                    <h:inputText id="city" value="#{userController.selected.city}" title="#{bundle.EditUserTitle_city}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_city}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_postalCode}" for="postalCode" />
                    <h:inputText id="postalCode" value="#{userController.selected.postalCode}" title="#{bundle.EditUserTitle_postalCode}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_postalCode}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_type}" for="type" />
                    <h:inputText id="type" value="#{userController.selected.type}" title="#{bundle.EditUserTitle_type}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_type}"/>
                    <h:outputLabel value="#{bundle.EditUserLabel_country}" for="country" />
                    <h:inputText id="country" value="#{userController.selected.country}" title="#{bundle.EditUserTitle_country}" required="true" requiredMessage="#{bundle.EditUserRequiredMessage_country}"/>
                </h:panelGrid>
                <h:commandLink action="#{userController.update}" value="#{bundle.EditUserSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditUserViewLink}"/>
                <br />
                <h:commandLink action="#{userController.prepareList}" value="#{bundle.EditUserShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index_old" value="#{bundle.EditUserIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
